package com.antler.smt.utils;

import com.antler.smt.enums.ResultCodeEnum;
import com.antler.smt.response.base.Result;
import org.springframework.data.redis.core.script.ReactiveScriptExecutor;

/**
 * 处理修改，更新后的返回结果集
 *
 * @author zhangyi
 * @date 2018/5/23 15:31
 */
public class ReturnResultUtil {

    /**
     * 统一操作返回数据处理
     *
     * @param SuccessDesc  成功是返回的信息
     * @param failDesc  错误时返回的信息
     * @param status 状态
     * @return
     */
    public static Result getResult(String SuccessDesc,String failDesc,int status){
        Result result = null;

            if(0 == status){
                result = new Result(ResultCodeEnum.APPEND_DATA_ERROR,failDesc);
            }else {
                result = new Result(ResultCodeEnum.OPERATION_SUCCESS,SuccessDesc);
            }
        return result;
    }
}
